Code of:

Terahertz Ptychography Enabled by Untrained Physics-driven Neural Networks:
Jingzhu Shao,1 Ping Tang,1 Xiangyu Zhao,1 Borui Xu,1 Bo Chen,1 Kai Wang,2 Gangyi Xu,2 Juncheng Cao,3,* 
and Chongzhao Wu1,**
1Center for Biophotonics, Institute of Medical Robotics, School of Biomedical Engineering, 
Shanghai Jiao Tong University, Shanghai, China
2 Key Laboratory of Infrared Imaging Materials and Detectors, Shanghai Institute of Technical Physics,
Chinese Academy of Sciences, Shanghai, China
3 Key Laboratory of Terahertz Solid State Technology, Shanghai Institute of Microsystem and Information Technology,
Chinese Academy of Sciences, Shanghai, China
*Correspondence: jccao@mail.sim.ac.cn
**Correspondence: czwu@sjtu.edu.cn



Python Files:
class_Angular_Spectrum.py   --->  angular spectrum method
imshift.py   --->  shift the object image
ePIE.py  ---> extended ptychographic iterative engine algorithm
DM.py  ---> difference maps algorithm
pdnet_two_Yne1.py  ---> Untrained Physics-driven Neural Network (UPNN)
YNet1.py ---> the neural network medule of UPNN

Data Files:
image3_8x8.mat ---> diffractions patterns
probe_R=65_double.mat ---> mask for UPNN
probe_est_initial.mat ---> initial guass of the probe for ePIE and DM
House.bmp ---> amplitude of the object 
cameraman.bmp ---> phase of the object